﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.UI;
using System.Web.UI.WebControls;
using Microsoft.Practices.Unity;
//using Microsoft.WindowsAzure.Storage.Blob.Protocol;
using PharmacyService;

namespace PharmacyWeb
{
    public partial class _Default : Page
    {
        [Dependency]
        public IProductoService ProdServ { get; set; }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                ContarProductos();
            }
            
        }
        [WebMethod]
        public void ContarProductos()
        {            
             var cantidad =0;

            cantidad = ProdServ.ExisteProductoByCanje();

             if (cantidad>0)
             {                 
                 ScriptManager.RegisterStartupScript(this.lblAction, GetType(),"lblAction","diHola();",true);                 
            }
             else
             {
                 lblAction.Text = "";
             }
        }

    }
}